/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.clinicplus.service;

import br.com.foxline.clinicplus.entity.ContaBancaria;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.Query;

/**
 *
 * @author roniere
 */
@Stateless
public class ContaBancariaServico extends GenericService<ContaBancaria> {

    public ContaBancariaServico() {
        super(ContaBancaria.class);
    }

    public List<ContaBancaria> autocomplete(String str) {
        String sql = "Select cb from ContaBancaria cb "
                + " where cb.status = true order by cb.id asc";
        Query query = getEntityManager().createQuery(sql);
        return (List<ContaBancaria>) query.getResultList();
    }

    public List<ContaBancaria> getContaCaixaFluxo() {
        String str = "Select cb from ContaBancaria cb where cb.contaFluxo = true and cb.status = true";
        Query query = getEntityManager().createQuery(str);
        return (List<ContaBancaria>) query.getResultList();
    }
}
